//===============================================================================
// Microsoft Architecture Strategy Team
// LitwareHR - SaaS Sample Application
//===============================================================================
// Copyright  Microsoft Corporation.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================



using System;
using System.Collections.Generic;
using System.Text;

using LitwareHR.Recruiting.Contract;
using Shp.Runtime.Contract;

namespace LitwareHR.Recruiting.Workflows
{
    public class EvaluationMoniker : IEvaluationMoniker
    {
        public event EventHandler<AcceptanceSubmittedEventArgs> AcceptanceSubmitted;
        public event EventHandler<InterviewSubmittedEventArgs> InterviewSubmitted;
        public event EventHandler<NegotiationSubmittedEventArgs> NegotiationSubmitted;
        public event EventHandler<RejectionSubmittedEventArgs> RejectionSubmitted;

        public void SubmitAcceptance(Guid id, Acceptance acceptance, Upn upn)
        {
            AcceptanceSubmittedEventArgs args = new AcceptanceSubmittedEventArgs(id, acceptance);
            args.Identity = upn.ToString();
            EventHandler<AcceptanceSubmittedEventArgs> evh = AcceptanceSubmitted;
            if (evh != null)
            {
                evh(null, args);
            }
        }

        public void SubmitInterview(Guid id, Interview interview, Upn upn)
        {
            InterviewSubmittedEventArgs args = new InterviewSubmittedEventArgs(id, interview);
            args.Identity = upn.ToString();
            EventHandler<InterviewSubmittedEventArgs> evh = InterviewSubmitted;
            if (evh != null)
            {
                evh(null, args);
            }
        }

        public void SubmitNegotiation(Guid id, Negotiation negotiation, Upn upn)
        {
            NegotiationSubmittedEventArgs args = new NegotiationSubmittedEventArgs(id, negotiation);
            args.Identity = upn.ToString();
            EventHandler<NegotiationSubmittedEventArgs> evh = NegotiationSubmitted;
            if (evh != null)
            {
                evh(null, args);
            }
        }

        public void SubmitRejection(Guid id, Rejection rejection, Upn upn)
        {
            RejectionSubmittedEventArgs args = new RejectionSubmittedEventArgs(id, rejection);
            args.Identity = upn.ToString();
            EventHandler<RejectionSubmittedEventArgs> evh = RejectionSubmitted;
            if (evh != null)
            {
                evh(null, args);
            }
        }
    }
}
